//获取本地数据
function getData(name) {
    var local = localStorage.getItem(name);
    if (local != null) {
        return JSON.parse(local);
    } else {
        return [];
    }
}

//添加本地数据
function saveData(data) {
    localStorage.setItem('resigter', JSON.stringify(data));
}


//
var book = getData('userPage-mobile');
console.log(book);


book.forEach(v => {

    $('#goods').append(`<div class="main-box">
    <div class="img">
    <a href='payover.html'><img src="${v.imgSrc}" alt=""></a>
    </div>
    <div class="text">
        <p class="name">${v.title}</p>
        <p class="place">万达影城（双流万达广场杜比影院店）</p>
        <p class="time">${v.date}</p>
        <p class="last">交易成功</p>
    </div>
</div>`)
});